// 7.07.07 Truy vấn thông tin
import { BasicColumn, BasicTable, FormSchema, TableAction, useTable } from "@/components/Table";
import { useTranslation } from "react-i18next";
export default function index() {
	const { t } = useTranslation();
	const schemas: FormSchema[] = [
		{
			label: t(`felix_ui.date_from`),
			field: "date_from",
			component: "DatePicker"
		},
		{
			label: t(`felix_ui.date_to`),
			field: "date_to",
			component: "DatePicker"
		},
		{
			label: t(`felix_ui.medicalSurgery`),
			component: "Select",
			field: "medicalSurgery",
			componentProps: {
				options: [
					{ label: t(`felix_ui.entitySurgery`), value: t(`felix_ui.entitySurgery`) },
					{ label: t(`felix_ui.surgeryConsent`), value: t(`felix_ui.surgeryConsent`) },
					{ label: t(`felix_ui.entityName`), value: t(`felix_ui.entityName`) },
					{ label: t(`felix_ui.hospitalization`), value: t(`felix_ui.hospitalization`) },
					{ label: t(`felix_ui.retirementDate`), value: t(`felix_ui.retirementDate`) },
					{ label: t(`felix_ui.consent`), value: t(`felix_ui.consent`) },
					{ label: t(`felix_ui.maintreatmentMethod`), value: t(`felix_ui.maintreatmentMethod`) },
					{ label: t(`felix_ui.operationRoom`), value: t(`felix_ui.operationRoom`) },
					{ label: t(`felix_ui.department`), value: t(`felix_ui.department`) },
					{ label: t(`felix_ui.place`), value: t(`felix_ui.place`) },
					{ label: t(`felix_ui.object`), value: t(`felix_ui.object`) },
					{ label: t(`felix_ui.gender`), value: t(`felix_ui.gender`) },
					{ label: t(`felix_ui.typeOfSurgery`), value: t(`felix_ui.typeOfSurgery`) }
				]
			}
		},
		{
			label: t(`felix_ui.PTTT_code`),
			component: "Select",
			field: "PTTT_code",
			componentProps: {
				options: [
					{ label: t(`felix_ui.entitySurgery`), value: t(`felix_ui.entitySurgery`) },
					{ label: t(`felix_ui.surgeryConsent`), value: t(`felix_ui.surgeryConsent`) },
					{ label: t(`felix_ui.entityName`), value: t(`felix_ui.entityName`) },
					{ label: t(`felix_ui.hospitalization`), value: t(`felix_ui.hospitalization`) },
					{ label: t(`felix_ui.retirementDate`), value: t(`felix_ui.retirementDate`) },
					{ label: t(`felix_ui.consent`), value: t(`felix_ui.consent`) },
					{ label: t(`felix_ui.maintreatmentMethod`), value: t(`felix_ui.maintreatmentMethod`) },
					{ label: t(`felix_ui.operationRoom`), value: t(`felix_ui.operationRoom`) },
					{ label: t(`felix_ui.department`), value: t(`felix_ui.department`) },
					{ label: t(`felix_ui.place`), value: t(`felix_ui.place`) },
					{ label: t(`felix_ui.object`), value: t(`felix_ui.object`) },
					{ label: t(`felix_ui.gender`), value: t(`felix_ui.gender`) },
					{ label: t(`felix_ui.typeOfSurgery`), value: t(`felix_ui.typeOfSurgery`) }
				]
			}
		},
		{
			label: t(`felix_ui.operationRoom`),
			component: "Select",
			field: "operationRoom",
			componentProps: {
				options: [
					{ label: t(`felix_ui.entitySurgery`), value: t(`felix_ui.entitySurgery`) },
					{ label: t(`felix_ui.surgeryConsent`), value: t(`felix_ui.surgeryConsent`) },
					{ label: t(`felix_ui.entityName`), value: t(`felix_ui.entityName`) },
					{ label: t(`felix_ui.hospitalization`), value: t(`felix_ui.hospitalization`) },
					{ label: t(`felix_ui.retirementDate`), value: t(`felix_ui.retirementDate`) },
					{ label: t(`felix_ui.consent`), value: t(`felix_ui.consent`) },
					{ label: t(`felix_ui.maintreatmentMethod`), value: t(`felix_ui.maintreatmentMethod`) },
					{ label: t(`felix_ui.operationRoom`), value: t(`felix_ui.operationRoom`) },
					{ label: t(`felix_ui.department`), value: t(`felix_ui.department`) },
					{ label: t(`felix_ui.place`), value: t(`felix_ui.place`) },
					{ label: t(`felix_ui.object`), value: t(`felix_ui.object`) },
					{ label: t(`felix_ui.gender`), value: t(`felix_ui.gender`) },
					{ label: t(`felix_ui.typeOfSurgery`), value: t(`felix_ui.typeOfSurgery`) }
				]
			}
		}
	];
	const columns: BasicColumn[] = [
		{
			title: t(`felix_ui.code`),
			dataIndex: "code"
		},
		{
			title: t(`felix_ui.content`),
			dataIndex: "content"
		},
		{
			title: t(`felix_ui.type`),
			dataIndex: "type"
		},
		{
			title: t(`felix_ui.city`),
			dataIndex: "city"
		},
		{
			title: t(`felix_ui.province`),
			dataIndex: "province"
		},
		{
			title: t(`felix_ui.total`),
			dataIndex: "total"
		},
		{
			title: t("felix_ui.action"),
			fixed: "right",
			render: (_, record) => (
				<TableAction
					actions={[
						{
							label: t("felix_ui.delete"),
							popConfirm: {
								title: t("felix_ui.delMessage"),
								confirm: handleDelete.bind(record.productId)
							}
						}
					]}
				/>
			)
		}
	];
	const getInfo = () => {
		let arr: any = [
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			},
			{
				code: "adefgsfdda",
				content: "This may be incorrect. Literally means stamping, Department, Pier but the semantics are not smooth",
				type: "green",
				city: "lundun",
				province: "USA",
				total: "15"
			}
		];
		return arr;
	};
	const [registerTable] = useTable({
		// api: productApi.getproductPage,
		dataSource: getInfo(),
		columns,
		formConfig: {
			labelWidth: 150,
			labelWrap: true,
			schemas,
			showActionButtonGroup: true,
			showAdvancedButton: false,
			baseColProps: { span: 6 },
			actionColOptions: { span: 18 }
		},
		bordered: true,
		useSearchForm: true
		// searchInfo: {
		// 	bizType: "2"
		// }
		// afterFetch: (res: any) => {
		// 	return res.map((item: any) => mergeObjects(item, item.bloods));
		// }
	});
	//删除角色
	const handleDelete = async (id: any) => {
		console.log("id", id);

		// // 发起删除
		// const res = await productApi.deleteproduct(id, "2");
		// reload();
		// if (!res) return message.error(t("viewComponents.patientInformation.deleteFailed"));
		// message.success(t("viewComponents.patientInformation.deleteSuccessfully"));
	};
	return (
		<div className="page">
			<BasicTable register={registerTable}></BasicTable>
		</div>
	);
}
